var LicenseModalDemo = angular.module('FusionStorUI.license', []);
LicenseModalDemo.controller('LicenseModalCtrl', ['$scope','$modal', '$http', function($scope, $modal, $http) {
    var modalInstance;
    $scope.templateData = '';
    $scope.open = function(url) {  
        $scope.item = {};
        $http.get(url).success(function(data){
            $scope.templateData = data;
            modalInstance = $modal.open({  
                template : $scope.templateData,
                controller : LicenseModalInstanceCtrl,  
                backdrop:'static',  
                keyboard: false,
                resolve : { 
                    item : function() {  
                        return $scope.item;  
                    }  
                }  
            });      
        });  
    };  

    $scope.close = function() {
        modalInstance.dismiss('cancel');  
    }
}]); 
var LicenseModalInstanceCtrl = function($scope, $modalInstance, item) {  
    $scope.item = item;  
    $scope.selected = {  
        item : $scope.item 
    };  
    $scope.customer_ok = function() {  
        submit_license_create();
    };  
    $scope.update = function() {
        
    };
    $scope.activation_ok = function() {
        submit_license_message();
    };
    $scope.import_ok = function() {
        submit_license_success();
    };
    $scope.cancel = function() {  
        $modalInstance.dismiss('cancel');  
    };  
    $scope.go_license_home = function(){
        license_message_ok();
    }
    $scope.go_license_message = function(){
        license_upload_ok();
    }
    $scope.go_license_success = function(){
        license_success_ok();
    }
};  

